<cfset BASE = CreateObject("component", "#session.rootDir#.cfc.base") />
<cfinclude template="/code_lib/SCF_Employee.cfm">
<cfinclude template="/code_lib/SCF_HR.cfm">
<cfinclude template="/code_lib/SCF_REGEX.cfm">
<cfoutput>
<!---HTML header, css links, js links, and page title--->
#BASE.htmlTerminationHeader(
    "/jquery/ui-1.8.5/jquery-ui.min.js,/jquery/plugins/scrollTo/jquery.scrollTo-1.4.2-min.js, ../js/Step3-TermSchedule.js", <!---JS links--->
    "/jquery/ui-1.8.5/themes/cupertino/jquery-ui.css", <!---CSS links--->
    "Step 3:  Termination Schedule", <!---Page Title--->
    "Status" <!---Active Nav Link--->
)#
<!---HTML header, css links, js links, and page title--->

<cfset mainQueries = CreateObject("component", "#session.rootDir#.cfc.queries") />
<cfset statusQueries = CreateObject("component", "#session.rootDir#.cfc.statusQueries") />

<cfif Session.bolAuth EQ True and (Session.strAuthType EQ Session.IT or Session.strAuthType EQ Session.HR)>		
    
	<cfset QUERIES.GetScheduledTerms = statusQueries.funcGetTerminationSCFStepWaiting(23) />	
	
	<h1 class="title">Step 3:  Termination Schedule </h1>
	<div class="entry">
		Welcome, #Session.arrEmpInfo.FirstName# #Session.arrEmpInfo.LastName#.  
		This report is provided as a "read only" reference for those 
		individuals who are scheduled to be terminated at a later 
        date.<BR /><BR />
        
        <cfform name="MyForm" >
			<cfif QUERIES.GetScheduledTerms.recordcount GT 0>
				<table cellspacing="1" cellpadding="2">                
					<tr>
                        <td>&nbsp;</td>
						<td><strong>Employee</strong></td>
						<td><strong>Supervisor</strong></td>
						<td><strong>Requestor</strong></td>                
						<td><strong>Effective Date</strong></td>
						<td><strong>HR Date</strong></td>
                        <td>&nbsp;</td>
					</tr>				
					<cfloop query="QUERIES.GetScheduledTerms">
						<cfset Employee = SCF_Employee_GetEmployee(QUERIES.GetScheduledTerms.RosettaID) />
						<cfset QUERIES.GetTermDetails = mainQueries.funcGetTermDetails(QUERIES.GetScheduledTerms.TermReqID, 23) />
						<cfset Supervisor = SCF_HR_WhosTheBoss(QUERIES.GetTermDetails.RosettaID) />
                        <cfset Supervisor = SCF_EMPLOYEE_GetEmployee(Supervisor) />
						<cfset Requestor = SCF_Employee_GetEmployee(QUERIES.GetTermDetails.InitialTermReqByID) />
						<tr id="#QUERIES.GetScheduledTerms.TermReqID#">
                            <td width="1%">#QUERIES.GetScheduledTerms.CurrentRow#.)</td>
							<td>#Employee.FullName#</td>
							<td>#Supervisor.FullName#</td>
							<td>#Requestor.FullName#</td>
							<td><cfinput type="text" name="TermDate#QUERIES.GetScheduledTerms.TermReqID#" size="13" value='#DateFormat(QUERIES.GetTermDetails.TermDate,"mm/dd/yyyy")#' error_message="Effective termination date must be given." /></td>
							<td><cfinput type="text" name="SysTermDate#QUERIES.GetScheduledTerms.TermReqID#" size="13" value='#DateFormat(QUERIES.GetTermDetails.SysTermDate,"mm/dd/yyyy")#' error_message="HR termination date must be given." /></td>
                            <td><cfinput type="button" name="TermReqID#QUERIES.GetScheduledTerms.TermReqID#" value='Save' /></td>
                            <!--- JS file Step3-TermSchedule.js handles form submition --->
						</tr>
					</cfloop>
				</table>			
			<cfelse>
                <span class="error">At the present time, there are not any employees scheduled for termination.</span>
			</cfif>
		</cfform>	
	</div>
<cfelse>
    <cfinclude template="../denied.cfm">
</cfif>


<!---HTML footer, closes html and body tags.  Any footer info goes here--->
#BASE.htmlTerminationFooter()#
<!---HTML footer, closes html and body tags.  Any footer info goes here--->
</cfoutput>